package us.wili.dev.model.base;

import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import us.wili.dev.common.model.BaseModelWithId;

public class BaseShopcart extends BaseModelWithId implements Serializable {
    @ApiModelProperty(value="用户id")
    private Long userid;

    @ApiModelProperty(value="商品id")
    private Long goodsId;

    @ApiModelProperty(value="商品数量")
    private Integer goodsNum;

    public Long getUserid() {
        return userid;
    }

    public void setUserid(Long userid) {
        this.userid = userid;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public Integer getGoodsNum() {
        return goodsNum;
    }

    public void setGoodsNum(Integer goodsNum) {
        this.goodsNum = goodsNum;
    }

    public void copyPropertiesFrom(BaseShopcart source) {
        this.setUserid(source.getUserid());
        this.setGoodsId(source.getGoodsId());
        this.setGoodsNum(source.getGoodsNum());
    }

    public void copyAndIgnoreNullFrom(BaseShopcart source) {
        if (source.getUserid() != null) {
            this.setUserid(source.getUserid());
        }
        if (source.getGoodsId() != null) {
            this.setGoodsId(source.getGoodsId());
        }
        if (source.getGoodsNum() != null) {
            this.setGoodsNum(source.getGoodsNum());
        }
    }
}